package com.bkgy.controller.allprocessDefect.controller;

import com.bkgy.controller.allprocessDefect.dao.AllprocessDefectDetailsRequest;
import com.bkgy.controller.allprocessDefect.dao.AllprocessDefectRequest;
import com.bkgy.controller.allprocessDefect.service.AllprocessDefectDetailService;
import com.bkgy.controller.allprocessDefect.service.AllprocessDefectService;
import com.bkgy.controller.completeflow.entity.CompleteFlowRequest;
import com.bkgy.controller.completeflow.service.CompleteFlowService;
import com.bkgy.sys.common.entity.ResultData;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;


/**
 * 成材率和质量缺陷关联
 */
@RestController
@RequestMapping("/allprocessDefect")
public class AllprocessDefectController {

    @Autowired
    private AllprocessDefectService service;

    @Autowired
    private AllprocessDefectDetailService service_details;

    @Operation(summary = "成材率和质量缺陷关联", description = "根据时间条件统计各个产线成材率和质量缺陷关联数据")
    @PostMapping("/getDetailData")
    public ResultData getDefectDate(@RequestBody @Valid AllprocessDefectRequest request) {
        return service.getDefectDate(request);
    }

    @Operation(summary = "成材率和质量缺陷关联明细", description = "根据时间条件统计各个产线成材率和质量缺陷关联明细数据")
    @PostMapping("/getDetailDatalist")
    public ResultData getDefectDetailsDate(@RequestBody @Valid AllprocessDefectDetailsRequest request) {
        return service_details.getDefectDetailsDate(request);
    }

}
